<!-- NOT IMPLEMENTED -->
<!-- {% load static %} -->
{% load book_extras %}
{% load notifications_tags %}
{% notifications_unread as unread_count %}
<nav class="navbar navbar-light  justify-content-between">
  <div class="col-6">
    <form  method="post"  action="{% url 'global_search'  %}" class="form-inline" >
      {% csrf_token %}
      <input
        class="form-control mr-sm-2"
        type="search"
        placeholder="Search"
        aria-label="Search"
        id="global_search"
        name='global_search'
      />
      <button class="btn btn-info my-2 my-sm-0" type="submit">Search</button>
    </form>
  </div>

  <div class="col-3">
      {% show_weather %}
  </div>


  <div class="col-3 ">

    <div class="nav-item dropdown float-right">
        
      {% if user.is_authenticated %}
      <h6
        class="nav-link dropdown-toggle"
        href="#"
        id="navbarDropdown"
        data-toggle="dropdown"
        aria-haspopup="true"
        aria-expanded="false"
      >

      {% if unread_count %}
            <svg viewBox="0 0 8 8"
                 width="8px"
                 height="8px">
                <circle cx="4"
                        cy="4"
                        r="4"
                        fill="#ff6b6b"
                        ></circle>
            </svg>
        {% endif %}
      {% if user.profile.profile_pic %}
      <img src="{{user.profile.profile_pic.url}}" style="width:30px;height:30px;border-radius:50%;"> 
      {%else%}
      <img src="{% static 'assets/images/user/avatar-2.jpg' %} "style="width:30px;height:30px;border-radius:50%;" alt="">
      {% endif %}
      {{user.username}}
      </h6>
      
      <div class="dropdown-menu" aria-labelledby="navbarDropdown">
        {% if request.user.profile.id %}
        <a
          class="dropdown-item"
          href="{% url 'profile_detail' request.user.profile.id %}"
          >My Profile</a
        >
        {% else %}
        <a class="dropdown-item" href="{% url 'profile_create' %}"
          >Create Profile</a
        >
        {% endif %}
        <div class="dropdown-divider"></div>

        {% if request.user.is_superuser %}
        <a class="dropdown-item" href="{% url 'notice_list' %}">Notification
          {% if unread_count %}
          <span class="badge badge-danger">{{ unread_count }}</span>
        {% endif %}
       </a>
       {% endif %}
        <a class="dropdown-item" href="{% url 'logout' %}">Logout</a>
      </div>

      {% else %}
      <a class="btn btn-primary" href="{% url 'login' %}"> Login </a>
      {% endif %}
    </div>
  </div>
</nav>
